<template>
  <div class="library">
    <div class="searchuser">
      <el-input
        v-model="searchform.no"
        placeholder="项目编号"
        size="normal"
        clearable
      ></el-input>
      <el-input
        v-model="searchform.name"
        placeholder="项目名称"
        size="normal"
        clearable
      ></el-input>
      <el-input
        v-model="searchform.type"
        placeholder="项目类型"
        size="normal"
        clearable
      ></el-input>
      <el-input
        v-model="searchform.address"
        placeholder="项目地址"
        size=""
        clearable
      ></el-input>
      <!-- <el-input
        v-model="searchform.starttime"
        placeholder="开始时间"
        size=""
        clearable
      ></el-input> -->
   <el-date-picker
              v-model="searchform.starttime"
              type="date"
              placeholder="选择日期"
              format="yyyy 年 MM 月 dd 日 "
              value-format="yyyy-MM-dd"
            >
   </el-date-picker>
      <el-button type="primary" size="default" @click="search">搜索</el-button>

      <el-button v-if="delBtn" size="default" @click="recycleLibrary"
        >回收站</el-button
      >
    </div>

    <el-table
      :fit="true"
      height="495px"
      size="medium"
      :data="tabledata"
      border
      stripe
    >
      <el-table-column
        show-overflow-tooltip
        v-for="col in columns"
        :prop="col.id"
        :key="col.id"
        :label="col.label"
        :width="col.width"
      >
      </el-table-column>
      <el-table-column width="220px">
        <template slot="header">
          <!-- <el-input v-model="search" size="mini" placeholder="输入关键字搜索" /> -->
          操作
        </template>
        <template slot-scope="scope">
          <el-button
            size="mini"
            @click="handleCheck(scope.$index, library, pageSize, currentPage)"
            >查看</el-button
          >
          <el-button
            v-if="delBtn"
            size="mini"
            type="danger"
            @click.native.prevent="
              handleDelete(scope.$index, library, pageSize, currentPage)
            "
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <div class="pageStyle">
      <el-pagination
        @current-change="handleCurrentChange"
        :current-page.sync="currentPage"
        :page-size="pageSize"
        :page-sizes="[1, 5, 10, 20]"
        layout="total,prev, pager, next, jumper"
        :total="library.length"
        :page-count="library.length / pageSize"
        hide-on-single-page
      >
      </el-pagination>
    </div>
    <div class="detaildiv">
      <!-- 审核项目详情 -->
      <el-dialog title="审核项目详情" :visible.sync="examVisible" fullscreen>
        <div class="dialogform">
          <!-- {{libraryitem}} -->
          <el-form ref="form" label-width="200px" :inline="false" size="small">
            <el-form-item
              v-for="item in examlib"
              :key="item.label"
              :label="item.label"
            >
              <el-input
                size="medium"
                :disabled="true"
                v-model="item.value"

              ></el-input>
            </el-form-item>
            <el-form-item label="项目任务书下载" size="normal">
              <a :href="downloadUrl" target="_blank" download=""
                ><el-button type="primary" size="default">下载附件</el-button>
              </a>
            </el-form-item>

            <el-form-item label="审批意见" size="normal">
              <el-input
                :autosize="{ minRows: 4, maxRows: 9 }"
                type="textarea"
                v-model="advice"
                placeholder="审批意见"
                size="small"
                clearable
              ></el-input>
            </el-form-item>
          </el-form>
        </div>
        <span slot="footer" class="dialog-footer">
          <el-button @click="examVisible = false">取 消</el-button>
          <el-button type="danger" @click="fail">审核未通</el-button>
          <el-button type="primary" @click="pass">审核通过</el-button>
        </span>
      </el-dialog>
      <!-- 三年五年库项目详情 -->
      <el-dialog
        title="三年滚动计划项目详情"
        :visible.sync="threelibraryVisible"
        :width="dialogwidth"
        fullscreen
      >
        <el-form
          ref="form"
          :model="libraryitem"
          label-width="200px"
          :inline="false"
          size="small"
        >
          <el-form-item label="项目编号" size="normal">
            <el-input
              v-model="libraryitem.threeProjectNo"
              placeholder=""
              size="normal"
              clearable
            ></el-input>
          </el-form-item>
          <el-form-item label="企业编号" size="normal">
            <el-input
              v-model="libraryitem.enterpriseId"
              placeholder=""
              size="normal"
              clearable
            ></el-input>
          </el-form-item>
          <el-form-item label="项目名称" size="normal">
            <el-input
              v-model="libraryitem.threeName"
              placeholder=""
              size="normal"
              clearable
            ></el-input>
          </el-form-item>
          <el-form-item label="项目预计投资规模(元)" size="normal">
            <el-input
              v-model="libraryitem.threeInvestment"
              placeholder=""
              size="normal"
              clearable
            ></el-input>
          </el-form-item>
          <el-form-item label="项目预计经济收益(元)" size="normal">
            <el-input
              v-model="libraryitem.threeRevenue"
              placeholder=""
              size="normal"
              clearable
            ></el-input>
          </el-form-item>
          <el-form-item label="项目类型" size="normal">
            <el-select
              v-model="libraryitem.threeProjectType"
              placeholder="请选择"
            >
              <el-option
                v-for="item in projecttype"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="项目具体类型" size="normal">
            <el-select
              v-model="libraryitem.threeSpecificType"
              placeholder="请选择"
            >
              <el-option
                v-for="item in specialtype"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="项目开工时间" size="normal">
            <el-date-picker
              v-model="libraryitem.threeStartTime"
              type="date"
              placeholder="选择日期"
              format="yyyy 年 MM 月 dd 日 "
              value-format="yyyy-MM-dd"

            >
            </el-date-picker>
          </el-form-item>
          <el-form-item label="项目生命周期" size="normal">
            <el-date-picker
              v-model="libraryitem.threeLifeCycle"
              type="date"
              placeholder="选择日期"
              format="yyyy 年 MM 月 dd 日 "
              value-format="yyyy-MM-dd"

            >
            </el-date-picker>
          </el-form-item>
          <el-form-item label="项目任务书下载" size="normal">
            <a :href="downloadUrl" target="_blank" download=""
              ><el-button type="primary" size="default">下载附件</el-button>
            </a>
          </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
          <el-button @click="threelibraryVisible = false">取 消</el-button>
          <el-button type="primary" @click="threeSubmit">编辑提交</el-button>
        </span>
      </el-dialog>
      <!-- 五年 -->
      <el-dialog
        title="亿元以上五年规划项目详情"
        :visible.sync="fivelibraryVisible"
        :width="dialogwidth"
        fullscreen
      >
        <el-form
          ref="form"
          :model="libraryitem"
          label-width="200px"
          :inline="false"
          size="small"
        >
          <el-form-item label="项目编号" size="normal">
            <el-input
              v-model="libraryitem.fiveProjectNo"
              placeholder=""
              size="normal"
              clearable
            ></el-input>
          </el-form-item>
          <el-form-item label="企业编号" size="normal">
            <el-input
              v-model="libraryitem.enterpriseId"
              placeholder=""
              size="normal"
              clearable
            ></el-input>
          </el-form-item>
          <el-form-item label="项目名称" size="normal">
            <el-input
              v-model="libraryitem.fiveName"
              placeholder=""
              size="normal"
              clearable
            ></el-input>
          </el-form-item>
          <el-form-item label="项目预计投资规模(元)" size="normal">
            <el-input
              v-model="libraryitem.fiveInvestment"
              placeholder=""
              size="normal"
              clearable
            ></el-input>
          </el-form-item>
          <el-form-item label="项目预计经济收益(元)" size="normal">
            <el-input
              v-model="libraryitem.fiveRevenue"
              placeholder=""
              size="normal"
              clearable
            ></el-input>
          </el-form-item>
          <el-form-item label="项目类型" size="normal">
            <el-select
              v-model="libraryitem.fiveProjectType"
              placeholder="请选择"
            >
              <el-option
                v-for="item in projecttype"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="项目具体类型" size="normal">
            <el-select
              v-model="libraryitem.fiveSpecificType"
              placeholder="请选择"
            >
              <el-option
                v-for="item in specialtype"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="项目开工时间" size="normal">
            <el-date-picker
              v-model="libraryitem.fiveStartTime"
              type="date"
              placeholder="选择日期"
              format="yyyy 年 MM 月 dd 日 "
              value-format="yyyy-MM-dd HH:mm:ss"
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item label="项目生命周期" size="normal">
            <div class="block">
              <el-date-picker
                v-model="libraryitem.fiveLifeCycle"
                type="date"
                placeholder="选择日期"
                format="yyyy 年 MM 月 dd 日 "
                value-format="yyyy-MM-dd HH:mm:ss"
              >
              </el-date-picker>
            </div>
            <!-- <el-date-picker
              v-model="libraryitem.fiveLifeCycle"

              type="date"
              placeholder="选择日期"
            >
            </el-date-picker> -->
          </el-form-item>
          <el-form-item label="项目任务书下载" size="normal">
            <a :href="downloadUrl" target="_blank" download=""
              ><el-button type="primary" size="default">下载附件</el-button>
            </a>
          </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
          <el-button @click="fivelibraryVisible = false">取 消</el-button>
          <el-button type="primary" @click="fiveSubmit">编辑提交</el-button>
        </span>
      </el-dialog>
      <!--回收站 -->
      <!-- ---------------------------------------------------------- -->
      <!-- 回收站 -->
      <el-dialog
        @closed="init"
        fullscreen
        title="项目回收"
        :visible.sync="recyleVisable"
        width="30%"
      >
        <span>
          <div class="userbody">
            <el-table height="430px" :data="tabledata" border stripe>
              <el-table-column
                v-for="col in columns"
                :prop="col.id"
                :key="col.id"
                :label="col.label"
                :width="col.width"
              >
              </el-table-column>
              <el-table-column label="操作">
                <template slot-scope="scope">
                  <el-button
                    size="mini"
                    type="success"
                    @click="
                      handleBack(scope.$index, library, pageSize, currentPage)
                    "
                    >恢复</el-button
                  >
                  <el-button
                    size="mini"
                    type="danger"
                    @click="
                      handleDelForever(
                        scope.$index,
                        library,
                        pageSize,
                        currentPage
                      )
                    "
                    >永久删除</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
            <div class="pageStyle">
              <el-pagination
                @current-change="handleCurrentChange"
                :current-page.sync="currentPage"
                :page-size="pageSize"
                :page-sizes="[1, 5, 10, 20]"
                layout="total,prev, pager, next, jumper"
                :total="library.length"
                :page-count="library.length / pageSize"
                hide-on-single-page
              >
              </el-pagination>
            </div>
          </div>
        </span>
      </el-dialog>
    </div>
  </div>
</template>

<script>
import Qs from "qs";
// import moment from "moment";
export default {
  data() {
    return {
      downloadUrl: "",
      projecttype: [
        { label: "基础建设类", value: "1" },
        { label: "技术改造类", value: "2" },
        { label: "单纯购置类项目", value: "3" },
      ],
      specialtype: [
        { label: "建筑行业", value: "0" },
        { label: "教育行业", value: "1" },
        { label: "水利，环境，公共设施", value: "2" },
        { label: "农，林，牧，渔业", value: "3" },
        { label: "电力，燃气，能源", value: "4" },
      ],

      delBtn: true,
      dialogwidth: "75%",
      pageSize: 9,
      currentPage: 1,
      // search: "",
      examVisible: false,
      threelibraryVisible: false,
      fivelibraryVisible: false,
      recyleVisable: false,
      searchform: {
        no: null,
        name: null,
        type: null,
        address: null,
        starttime: null,
      },
      currentcol: {
        index: "",
      },
      // 审批意见
      advice: "",
      // 表格列
      columns: [
        { label: "项目编号", id: "projectNo" },
        { label: "项目名称", id: "applyName", width: "300px" },
        { label: "项目类型", id: "projectTypeDesc" },
        { label: "项目具体类型", id: "specificTypeDesc" },
        { label: "项目地址", id: "projectAddress" },
        { label: "开始时间", id: "startTime" },
      ],

      // 拿到的库
      library: [],
      // 拿到的对应的行的项目
      libraryitem: {},
      librarylib: [],
      examlib: [
        { label: "项目编号", value: "", id: "projectNo" },
        { label: "企业编号", value: "", id: "enterpriseId" },
        { label: "项目名称", value: "", id: "applyName" },
        { label: "项目地址", value: "", id: "projectAddress" },
        { label: "项目类型", value: "", id: "projectTypeDesc" },
        { label: "项目具体类型", value: "", id: "specificTypeDesc" },
        { label: "项目预计投资规模(元)", value: "", id: "investment" },
        { label: "项目预计经济收益(元)", value: "", id: "revenue" },
        { label: "项目预计开工时间", value: "", id: "startTime" ,maxlength:'10'},
        { label: "项目生命周期", value: "", id: "lifeCycle" ,maxlength:'10'},
        // { label: "项目任务书", value: "", id: "projectAssignmentPaper" },
      ],

      waitcheck: [],
    };
  },
  computed: {
    //     threeStart:function(){
    // return moment(new Date(parseInt(this.libraryitem.threeStartTime))).format("YYYY-MM-DD")
    //     },
    //     threeLife:function(){
    // return moment(new Date(parseInt(this.libraryitem.threeLifeCycle))).format("YYYY-MM-DD")

    //     },
    //     fiveStart:function(){
    // return 1

    //     },
    //     fiveLife:function(){
    // return 1
    //     },
    examdata: function () {
      return {
        projectNo: this.libraryitem.projectNo,
        auditOpinion: this.advice,
      };
    },
    searchDesc: function () {
      return (
        this.searchform.no +
        this.searchform.name +
        this.searchform.type +
        this.searchform.address +
        this.searchform.starttime
      );
    },
    // 将获取的库的表分页
    tabledata: function () {
      return this.library.slice(
        (this.currentPage - 1) * this.pageSize,
        this.currentPage * this.pageSize
      );
    },
  },
  methods: {
    // 审核库获取
    async examget() {
      this.delBtn = false;
      this.columns[0].id = "projectNo";
      this.columns[1].id = "applyName";
      this.columns[2].id = "projectTypeDesc";
      this.columns[3].id = "specificTypeDesc";
      this.columns[4].id = "projectAddress";
      this.columns[5].id = "startTime";
      await this.$http
        .get("/apply/queryList", {
          params: {
            projectNo: this.searchform.no,
            applyName: this.searchform.name,
            projectType: this.searchform.type,
            projectAddress: this.searchform.address,
            startTime: this.searchform.starttime,
          },
        })
        .then((result) => {
          console.log(result.data.data);

          if (result.data.data == null) {
            this.library = [];
          } else {
            this.library = result.data.data.data;
          }
        })
        .catch((err) => {
          console.log(err);
        });
      // console.log(result);
    },
    // 三年库获取
    async threeget() {
      this.delBtn = true;
      this.columns[0].id = "threeProjectNo";
      this.columns[1].id = "threeName";
      this.columns[2].id = "projectTypeDesc";
      this.columns[3].id = "specificTypeDesc";
      this.columns[4].id = "threeProjectAddress";
      this.columns[5].id = "threeStartTime";
      await this.$http
        .get("/three/queryList", {
          params: {
            threeProjectNo: this.searchform.no,
            threeName: this.searchform.name,
            threeProjectType: this.searchform.type,
            threeProjectAddress: this.searchform.address,
            threeStartTime: this.searchform.starttime,
          },
        })
        .then((result) => {
          if (result.data.data == null) {
            this.library = [];
          } else {
            this.library = result.data.data.data;
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    // 五年库获取
    async fiveget() {
      this.delBtn = true;
      this.columns[0].id = "fiveProjectNo";
      this.columns[1].id = "fiveName";
      this.columns[2].id = "projectTypeDesc";
      this.columns[3].id = "specificTypeDesc";
      this.columns[4].id = "fiveProjectAddress";
      this.columns[5].id = "fiveStartTime";
      await this.$http
        .get("/five/queryList", {
          params: {
            fiveProjectNo: this.searchform.no,
            fiveName: this.searchform.name,
            fiveProjectType: this.searchform.type,
            fiveProjectAddress: this.searchform.address,
            fiveStartTime: this.searchform.starttime,
          },
        })
        .then((result) => {
          if (result.data.data == null) {
            this.library = [];
          } else {
            this.library = result.data.data.data;
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    // 根据导航栏路由判断显示的库
    init() {
      switch (this.$route.params.value) {
        case "library-examine":
          this.examget();

          break;
        case "library-three":
          this.threeget();

          break;
        case "library-five":
          this.fiveget();

          break;

        default:
          break;
      }
      this.currentPage = 1;
    },
    //  页面更换
    handleCurrentChange(val) {
      this.currentPage = val;
    },
    // 删除按钮消息提醒
    handleDelete(i, l, p, c) {
      // console.log(i+l+p+c);
      this.$confirm("此操作将删除该文件, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          // 注意：此处应改成行隐藏和状态码转换
          // l.splice(p * (c - 1) + i, 1);
          switch (this.$route.params.value) {
            case "library-three":
              this.$http
                .post(
                  "/three/delete",
                  Qs.stringify({
                    threeProjectNo: l[p * (c - 1) + i].threeProjectNo,
                  })
                )
                .then(() => {
                  this.init();

                  // l.splice(p * (c - 1) + i, 1);

                  this.$message({
                    type: "success",
                    message: "删除成功!",
                  });
                })
                .catch((err) => {
                  console.log(err);
                });

              break;
            case "library-five":
              this.$http
                .post(
                  "/five/delete",
                  Qs.stringify({
                    fiveProjectNo: l[p * (c - 1) + i].fiveProjectNo,
                  })
                )
                .then(() => {
                  this.init();

                  // l.splice(p * (c - 1) + i, 1);

                  this.$message({
                    type: "success",
                    message: "删除成功!",
                  });
                })
                .catch((err) => {
                  console.log(err);
                });

              break;

            default:
              break;
          }
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    // 搜索按钮
    search() {
      this.init();
      this.searchform.no = null;
      this.searchform.name = null;
      this.searchform.type = null;
      this.searchform.address = null;
      this.searchform.starttime = null;
    },
    // 监听搜索框
    watchSearch() {
      if (this.searchDesc == "nullnullnullnull" || this.searchDesc == "") {
        this.init();
      }
    },
    // 查看按钮
    handleCheck(i, l, p, c) {
      // console.log(l[p*(c-1)+i]);
      // this.currentcol.index=i
      this.libraryitem = l[p * (c - 1) + i];
      if (this.$route.params.value == "library-examine") {
        this.downloadUrl = `http://192.168.43.140:8091/apply/download?projectNo=${this.libraryitem.projectNo}`;
        this.examlib.forEach((element) => {
          for (var index in this.libraryitem) {
            for (var key in element) {
              if (key == "id") {
                if (element[key] == index) {
                  element.value = this.libraryitem[index];
                }
              }
            }
          }
        });
        // console.log(this.libraryitem);
        this.examVisible = true;
      }
      if (this.$route.params.value == "library-three") {
        this.downloadUrl = `http://192.168.43.140:8091/three/download?threeProjectNo=${this.libraryitem.projectNo}`;
        this.threelibraryVisible = true;
      }

      if (this.$route.params.value == "library-five") {
        this.downloadUrl = `http://192.168.43.140:8091/five/download?fiveProjectNo=${this.libraryitem.projectNo}`;
        this.fivelibraryVisible = true;
      }
    },
    // 三年提交
    threeSubmit() {
      this.$http
        .post("/three/update", Qs.stringify(this.libraryitem))
        .then((result) => {
          console.log(result);
          this.threelibraryVisible = false;
          this.init();
        })
        .catch((err) => {
          console.log(err);
        });
    },
    // 五年提交
    fiveSubmit() {
      this.$http
        .post("/five/update", Qs.stringify(this.libraryitem))
        .then((result) => {
          console.log(result);
          this.fivelibraryVisible = false;
          this.init();
        })
        .catch((err) => {
          console.log(err);
        });
    },
    // 审批通过
    async pass() {
      await this.$http
        .post("/admin/auditProjectSuccess", Qs.stringify(this.examdata))
        .then((result) => {
          console.log(result);
        })
        .catch((err) => {
          console.log(err);
        });
      this.examVisible = false;
      this.examget();
    },
    async fail() {
      await this.$http
        .post("/admin/toExamineFail", Qs.stringify(this.examdata))
        .then((result) => {
          console.log(result);
        })
        .catch((err) => {
          console.log(err);
        });
      this.examVisible = false;
      this.examget();
    },
    // 回收站
    recycleLibrary() {
      switch (this.$route.params.value) {
        // case "library-examine":
        //   this.examget();

        //   break;
        case "library-three":
          this.$http
            .get("/three/listDelete")
            .then((result) => {
              // console.log(result);
              if (result.data.data == null) {
                this.library = [];
              } else {
                this.library = result.data.data.data;
              }
              this.recyleVisable = true;
            })
            .catch((err) => {
              console.log(err);
            });

          break;
        case "library-five":
          this.$http
            .get("/five/listDelete")
            .then((result) => {
              // console.log(result);
              if (result.data.data == null) {
                this.library = [];
              } else {
                this.library = result.data.data.data;
              }
              this.recyleVisable = true;
            })
            .catch((err) => {
              console.log(err);
            });

          break;

        default:
          break;
      }
      // this.currentPage = 1;
    },
    // 恢复
    handleBack(i, l, p, c) {
      this.$confirm("此操作将恢复该项目, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          // 注意：此处应改成行隐藏和状态码转换
          // console.log(l[i].adminNo);
          switch (this.$route.params.value) {
            case "library-three":
              this.$http
                .post(
                  "/three/reduction",
                  Qs.stringify({
                    threeProjectNo: l[p * (c - 1) + i].threeProjectNo,
                  })
                )
                .then(() => {
                  this.recycleLibrary();

                  // l.splice(p * (c - 1) + i, 1);

                  this.$message({
                    type: "success",
                    message: "恢复成功!",
                  });
                })
                .catch((err) => {
                  console.log(err);
                });

              break;
            case "library-five":
              this.$http
                .post(
                  "/five/reduction",
                  Qs.stringify({
                    fiveProjectNo: l[p * (c - 1) + i].fiveProjectNo,
                  })
                )
                .then(() => {
                  this.recycleLibrary();

                  // l.splice(p * (c - 1) + i, 1);

                  this.$message({
                    type: "success",
                    message: "恢复成功!",
                  });
                })
                .catch((err) => {
                  console.log(err);
                });

              break;

            default:
              break;
          }

          //   this.init()
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    // 永久删除用户
    handleDelForever(i, l, p, c) {
      this.$confirm("!!! 此操作将永久删除项目, 是否继续? !!!", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "error",
      })
        .then(() => {
          // 注意：此处应改成行隐藏和状态码转换
          // console.log(l[i].adminNo);
          switch (this.$route.params.value) {
            case "library-three":
              this.$http
                .post(
                  "/three/cleanThree",
                  Qs.stringify({
                    threeProjectNo: l[p * (c - 1) + i].threeProjectNo,
                  })
                )
                .then((res) => {
                  console.log(res);
                  this.recycleLibrary();

                  // l.splice(p * (c - 1) + i, 1);

                  this.$message({
                    type: "success",
                    message: "删除成功!",
                  });
                })
                .catch((err) => {
                  console.log(err);
                });

              break;
            case "library-five":
              this.$http
                .post(
                  "/five/cleanFive",
                  Qs.stringify({
                    fiveProjectNo: l[p * (c - 1) + i].fiveProjectNo,
                  })
                )
                .then((res) => {
                  console.log(res);
                  this.recycleLibrary();

                  // l.splice(p * (c - 1) + i, 1);

                  this.$message({
                    type: "success",
                    message: "删除成功!",
                  });
                })
                .catch((err) => {
                  console.log(err);
                });

              break;

            default:
              break;
          }

          //   this.init()
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
  },
  watch: {
    $route: "init",
    // searchDesc: "watchSearch",
  },
  created() {
    this.init();
  },
};
</script>

<style>
.pageStyle {
  text-align: center;
}
.pageStyle .el-pagination {
  padding: 0px;
}
.detaildiv .el-input.is-disabled .el-input__inner {
  color: black;
}
.dialogform {
  margin: 0px auto;
  width: 80%;
}
</style>